package com.ssy.lingxi.report.api.enums;

import com.ssy.lingxi.common.language.LanguageHolder;

import java.util.Arrays;

/**
 *  投标操作类型枚举
 * @author ds
 * @date 2021/5/11
 * @version 2.0.0
 */
public enum PurchaseTenderOperateTypeEnum {
    TO_BE_SIGNUP_COUNT(1,"待招标报名","/memberCenter/procurementAbility/tender/readyBidRegister"),
    TO_BE_COMMIT_QUALIFICATION_COUNT(2,"待提交资格预审","/memberCenter/procurementAbility/tender/readyQualifityChecked"),
    TO_BE_COMMIT_VALIFY_COUNT(3,"待提交审核投标","/memberCenter/procurementAbility/tender/readyAddTender"),
    TO_BE_VALIFY_STEP1_COUNT(4,"待审核投标（一级）","/memberCenter/procurementAbility/tender/firstCheckedTender"),//todo ds
    TO_BE_VALIFY_STEP2_COUNT(5,"待审核投标（二级）","/memberCenter/procurementAbility/tender/secondCheckedTender"),
    TO_BE_COMMIT_COUNT(6,"待提交投标","/memberCenter/procurementAbility/tender/readySubmitTender"),
    ;
    /**
     * 编码
     */
    private final Integer code;
    /**
     * 名称
     */
    private final String name;
    /**
     * 链接
     */
    private final String link;


    PurchaseTenderOperateTypeEnum(Integer code, String name, String link) {
        this.code = code;
        this.name = name;
        this.link = link;
    }

    public static PurchaseTenderOperateTypeEnum getEnum(Integer code) {
        return Arrays.stream(PurchaseTenderOperateTypeEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);
    }


    public Integer getCode() {
        return code;
    }

    public String getName() {
        return LanguageHolder.getName(this.getClass(), this.code);
    }

    public String getLink() {
        return link;
    }
}
